import java.net.*;  
import java.io.*;  

class testobject implements Serializable {  
	int value ;  
	String id;  
	public  testobject(int v, String s ){  
		this.value=v;  
		this.id=s;  
	}  
}  

public class Testing  {  
	public static void main(String args[]) {  
		int port = 2002;  
		try {  
			/*ServerSocket ss = new ServerSocket(port);  
			Socket s = ss.accept();  
			InputStream is = s.getInputStream();
			BufferedReader receiveObject = new BufferedReader(new InputStreamReader(is));
			System.out.println(receiveObject.readLine());
			s = ss.accept();  
			is = s.getInputStream();
			ObjectInputStream ois = new ObjectInputStream(is);
			Maze to = (Maze)ois.readObject();
			if (to!=null) to.printMaze();
			else System.out.println("NULL!");*/
			//System.out.println((String)ois.readObject());  
			//is.close();  
			//s.close();  
			//ss.close();
			ServerConnection.openListeningConnection(port);
			String  msg = ServerConnection.receive();
			System.out.println(msg);
			Maze to = ServerConnection.receiveGameState();
			if (to!=null) 
				{
				to.printMaze();
				System.out.println(to.getPlayers().size());
				}
			else System.out.println("NULL!");
			
		}catch(Exception e){System.out.println(e);}  
		}  
	}  